package com.easyaop.api.pointcut;

import java.util.Objects;

public abstract class Pointcut {
    protected final String signature;

    public Pointcut(String signature) {
        this.signature = signature;
    }

    @Override
    public final boolean equals(Object obj) {
        return obj instanceof Pointcut && equals((Pointcut) obj);
    }

    public final boolean equals(Pointcut pointcut) {
        return Objects.equals(signature, pointcut.signature);
    }

    @Override
    public final int hashCode() {
        return Objects.hash(signature);
    }

    public abstract boolean isClass(ClassObject clz);

    public abstract boolean isMethod(MethodObject method);
}
